<?php if (isset($afterwork->id)): ?>
	<div id="afterwork">
		<a class="vote" data-afterid="<?php echo $afterwork->id?>" href="/Afterwork/Confirm/Vote/Yes/" data-role="button" data-icon="thumbup" data-iconpos="notext"></a>
		<a class="vote" data-afterid="<?php echo $afterwork->id?>" href="/Afterwork/Confirm/Vote/No/" data-role="button" data-icon="thumbdown" data-iconpos="notext">Je kiffe pas</a>
		<div class="proposer"><?php echo $afterwork->GetProposer()->username; ?></div>
		<div class="title"><?php echo $afterwork->place; ?></div>
		<div class="date"><?php echo date('d/m/y',strtotime($afterwork->date)); ?></div>
		<div class="description"><?php echo str_replace("\n",'<br/>',$afterwork->description); ?></div>		
		<a class="openPopup" href="#Subscribers" data-role="button">Voir tous les participants (<?php echo count($subscribers_yes);?>)</a>
		<a class="openPopup" href="#Sondage" data-role="button">Status</a>
	
		<div data-role="popup" id="Sondage">
			<div class="popupCss">
				<a href="/Afterwork/Confirm/Answer/Yes/" data-afterid="<?php echo $afterwork->id?>" data-role="button">Je viens</a>
				<a href="/Afterwork/Confirm/Answer/No/" data-afterid="<?php echo $afterwork->id?>" data-role="button">Je ne viens pas</a>
			</div>
		</div>
		
		<div data-role="popup" id="Subscribers">
		<?php if (count($subscribers) == 0):?>
			<div class="no-subscribers">Aucun participant pour le moment...</div>
		<?php else:?>
			<ul data-role="listview">
			<?php	
				$countAnswerYes = 0;
				$countAnswerNo = 0;
				
				foreach($subscribers as $sub):
			?>	
				
				<?php if ($sub->answer == 'Yes') $countAnswerYes++;?>
				<?php if ($sub->answer == 'No') $countAnswerNo++;?>
				
				<?php if ($countAnswerYes == 1):$countAnswerYes++;?>
				<li data-role="list-divider">Participent</li>
				<?php endif;?>
				
				<?php if ($countAnswerNo == 1):$countAnswerNo++;?>
				<li data-role="list-divider">Ne participent pas</li>
				<?php endif;?>
				
				<li><?php echo $sub->GetUsername();?></li>
			<?php endforeach; ?>
			</ul>
		<?php endif;?>
		</div>
	</div>
<?php endif; ?>
